package com.monitor.app_monitor.service.quartz.task;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.monitor.app_monitor.config.ClickHouseConfig;
import com.monitor.app_monitor.entity.EmsInfo;
import com.monitor.app_monitor.entity.TableList;
import com.monitor.app_monitor.entity.TaskLogAnnotation;
import com.monitor.app_monitor.entity.mapper.RealTimeAlarmClickhouseMapper;
import com.monitor.app_monitor.entity.mapper.ResUnifClickhouseMapper;
import com.monitor.app_monitor.mapper.EmsInfoMapper;
import com.monitor.app_monitor.mapper.TableListMapper;
import com.monitor.app_monitor.service.quartz.utils.ExecuteScript;
import com.monitor.app_monitor.service.quartz.utils.logUtils;
import io.micrometer.core.instrument.ImmutableTag;
import io.micrometer.core.instrument.Tag;
import lombok.extern.slf4j.Slf4j;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @ClassName dataNbCheck.java
 * @Author ning
 * @Description TODO
 * @CreateTime 2021年12月13日 17:11:00
 */


@DisallowConcurrentExecution //作业不并发
@Component
@Slf4j
public class PmNceS implements Job {

    @Resource
    private ExecuteScript executeScript;

    @Resource
    @Qualifier("PmNceS")
    private Map<String, AtomicInteger> PmNceS;

    @TaskLogAnnotation
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

    /**
     * 分网管监控一干数据
     */



        try {
            Integer rgEmsInfos = executeScript.executePmNceSScript();
            log.info("查询当前文件夹：{}",rgEmsInfos);
            PmNceS.get("pm_nce_s").set(rgEmsInfos);

        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
